#include "stdio.h"
int pointer_a = 10;
int pointer_b = 100;
int *pointer_q;
int **pointer_qq;

void pointer_one(int *p)
{
    printf("--->note:3   [%s]:&p=%p,p=%p\n", __FUNCTION__, &p, p);
    p = &pointer_b;
    printf("--->note:4   [%s]:&p=%p,p=%p\n", __FUNCTION__, &p, p);
}

void pointer_two(int **p)
{
    printf("--->note:6   [%s]:&p=%p,p=%p\n", __FUNCTION__, &p, p);
    *p = &pointer_b;
    printf("--->note:7   [%s]:&p=%p,p=%p\n", __FUNCTION__, &p, p);
}

void pointer_demo(void)
{
    printf("--->note:1   [%s] pointer_a=%p, pointer_b=%p, pointer_q=%p\n", __FUNCTION__, &pointer_a, &pointer_b, &pointer_q);
    pointer_q = &pointer_a;
    printf("--->note:2   [%s] *pointer_q=%d, pointer_q=%p, &pointer_q=%p\n", __FUNCTION__, *pointer_q, pointer_q, &pointer_q);
    pointer_one(pointer_q);
    printf("--->note:5   [%s] *pointer_q=%d, pointer_q=%p, &pointer_q=%p\n", __FUNCTION__, *pointer_q, pointer_q, &pointer_q);
    pointer_two(&pointer_q);
    printf("--->note:8   [%s] *pointer_q=%d, pointer_q=%p, &pointer_q=%p\n", __FUNCTION__, *pointer_q, pointer_q, &pointer_q);
    pointer_q = &pointer_a;
    pointer_qq = &pointer_q;
    pointer_two(pointer_qq);
    printf("--->note:9   [%s] **pointer_qq=%d, *pointer_qq=%p, pointer_qq=%p, &pointer_qq=%p\n", __FUNCTION__, **pointer_qq, *pointer_qq, pointer_qq, &pointer_qq);
}